<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<style type="text/css">
#master {
	text-align: center;
}

.showtd a {
	margin: 0px 5px;
}

.showtr td {
	padding: 2px 0px;
}

.da {
	text-align: left;
}

#connect {
	width: 100％;
	height: 40px;
	position: relative;
	top: 0px;
	font-family: arial, helvetica;
	font-size: 12px;
	text-align: center;
	border-top: 1px dashed lightgrey;
	padding-top: 8px;
}

#item {
	width: 80px;
	white-space: nowrap;
	word-break: keep-all;
	overflow: hidden;
}

.calendarContent {
	width: 105px;
	height: 94px;
	/*background: #F7941D;*/
}

/*
.calendarContentOn {
	background: #F0801D;
}
*/
.calendarTitle {
	width: 100%;
	height: 20px;
	/*background: #A5BFE1;*/
	background: #D9D9D9;
	text-align: left;
	cursor: pointer;
}

.calendarDiv {
	width: 95px;
	margin: 0px auto;
	height: 20px;
	margin: 2px;
	padding: 2px;
	background: #A5BFE1;;
	cursor: pointer;
}

.calendarDivOn {
	background: #60C150;
}

.calendarImg {
	width: 20px;
	height: 20px;
	float: left;
}

.calendarImg img {
	width: 18px;
	height: 18px;
	margin: 0px;
	float: left;
}

.calendarSubject {
	font-size: 14px;
	padding: 2px;
	width: 70px;
	height: 20px;
	float: left;
	overflow: hidden;
	white-space: nowrap;
}

.calendarBottom {
	float: right;
	padding: 5px;
}
</style>

		<script type="text/javascript">
$(function() {
	$(".calendarContent").mousemove(function() {
		$(".calendarContent").removeClass("calendarContentOn");
		$(this).addClass("calendarContentOn");
	});
	$(".calendarDiv").hover(function() {
		$(".calendarDiv").removeClass("calendarDivOn");
		$(this).addClass("calendarDivOn");
	}, function() {
		$(".calendarDiv").removeClass("calendarDivOn");
	})

	$(".calendarTitle").click(
			function() {
				var obj = $(this);
				var year = obj.attr("year");
				var month = obj.attr("month");
				var day = obj.attr("day");
				var url = "${path}/routine/calendar/index/definite?year="
						+ year + "&month=" + month + "&day=" + day;
				location.href = url;
				return false;
			});
	/*
	$(".calendarDiv").bind("click", function() {
		var obj = $(this);
		var calid = obj.attr("val");
		calid = encodeURIComponent(calid);
		var url = "${path}/routine/calendar/index/content?ID=" + calid;
		location.href = url;
		return false;
	});
	 */

	$(".more").click(function() {
		art.dialog( {
			id : "more"
		}).close();
		art.dialog( {
			id : "more",
			padding : 0,
			title : false,
			follow : this,
			content : $(this).next().html()
		});

	});

	$("#selYear,#selMonth").change(
			function() {
				var year = $("#selYear").val().replace(" ","");
				var month = $("#selMonth").val().replace(" ","");

				location.href = "${path}/routine/calendar/index/show?year="
						+ year + "&month=" + month;
			})
});
function calendarDivClick(o) {
	var obj = $(o);
	var calid = obj.attr("val");
	calid = encodeURIComponent(calid);
	var url = "${path}/routine/calendar/index/content?ID=" + calid;
	location.href = url;
	return false;
}
</script>
	</head>



	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>
 
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					行事日历
				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding: 8px;">
					<div class="rili">
						<table width="100%">
							<tr>
								<td colspan="2">
									<a
										href="${path }/routine/calendar/index/show?year=${year-1}&month=${month}">&lt;&lt;</a>&nbsp;&nbsp;&nbsp;&nbsp;
									<a
										href="${path }/routine/calendar/index/show?year=${year}&month=${month-1}">&lt;</a>
									<span class='STYLE4'> <select class="selectbox"
											id="selYear">
											<c:forEach items="${yearList}" var="y">
												<option <c:if test="${year==y}">selected</c:if>>
													${y}
												</option>
											</c:forEach>
										</select> 年 <select class="selectbox" id="selMonth">
											<c:forEach items="${monthList}" var="m">
												<option <c:if test="${month==m}">selected</c:if>>
													${m}
												</option>
											</c:forEach>
										</select>月 </span><a
										href="${path }/routine/calendar/index/show?year=${year}&month=${month+1}">&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;
									<a
										href="${path }/routine/calendar/index/show?year=${year+1}&month=${month}">&gt;&gt;</a>
								</td>
							</tr>
							<tr>
								<td style="text-align: left;">
									建国${jianguo}年&nbsp;农历${cycli}年&nbsp;【${animalsYear}】
								</td>
								<td style="text-align: right;">
									<a
										href="${path }/routine/calendar/index/show?year=${nowYear}&month=${nowMonth}">本月</a>
								</td>
							</tr>
						</table>
						<table width="100%" class="rili-datalist">
							<thead>
								<tr>
									<th style="">
										星期日
									</th>
									<th style="">
										星期一
									</th>
									<th style="">
										星期二
									</th>
									<th style="">
										星期三
									</th>
									<th style="">
										星期四
									</th>
									<th style="">
										星期五
									</th>
									<th style="">
										星期六
									</th>
								</tr>
							</thead>
							<tbody>
  
								<c:forEach items="${calendarList }" var="weekCalendar"
									varStatus="s">
									<tr height="57">
										<c:forEach items="${weekCalendar }" var="cal" varStatus="s">
											<c:if test="${cal==null}">
												<td align="center" style="border: 1px solid #e9edf5;">
													&nbsp;
												</td>
											</c:if>
											<c:if test="${cal!=null}">
												<td align="center" style="border: 1px solid #e9edf5;">
													<div
														class='calendarContent <c:if test="${cal.day==nowDay && nowYear==cal.year && nowMonth==cal.month}">rilibox-corrent</c:if>'>
														<div class="calendarTitle" year="${year}" month="${month}"
															day="${cal.day}">
															${cal.day}
															<span style="float: right;">${cal.nongli}</span>
														</div>
														<c:forEach items="${cal.saleAppointment}" var="sal"
															varStatus="status">
															<c:if test="${status.index <2}"> 
																<div class="calendarDiv" val="${sal.id}"
																	onclick="calendarDivClick(this);"
																	title="${fn:substringBefore(sal.categories,',')}:${sal.subject}">
																	<div class="calendarImg">
																		<img
																			src="${path }/images/MessageIcon/${urlMap[fn:substringBefore(sal.categories,',')]==null?'000.gif':urlMap[fn:substringBefore(sal.categories,',')]}"></img>
																	</div>
																	<div class="calendarSubject">
																		${sal.subject}
																	</div> 
																</div>
															</c:if>
														</c:forEach>
														<c:if test="${cal.more}">
															<div class="calendarBottom" style="line-height: 10px;">
																<a href="javascript:void(0);" class="more"
																	style="text-decoration: none;" year="${year}"
																	month="${month}" day="${cal.day}"> >></a>
																<div style="display: none;">
																	<c:forEach items="${cal.saleAppointment}" var="sal"
																		varStatus="status">


																		<div class="calendarDiv" val="${sal.id}"
																			onclick="calendarDivClick(this);"
																			title="${fn:substringBefore(sal.categories,',')}:${sal.subject}">
																			<div class="calendarImg">
																				<img
																					src="${path }/images/MessageIcon/${urlMap[fn:substringBefore(sal.categories,',')]==null?'000.gif':urlMap[fn:substringBefore(sal.categories,',')]}"></img>
																			</div>
																			<div class="calendarSubject">
																				${sal.subject}
																			</div>
																		</div>
																	</c:forEach>

																</div>
															</div>
														</c:if>


													</div>
												</td>
											</c:if>

										</c:forEach>
									</tr>
								</c:forEach>
 
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="webpart-foot">
				<div class="webpart-foot-item">
				</div>
			</div>
		</div>


		<sfa:mainFooter></sfa:mainFooter>

	</body>
</html>


